package cc.vv.btpartyjob.jobactivities.delegate

import android.view.View
import cc.vv.baselibrary.view.BaseTopBarView
import cc.vv.baselibrary.view.banner.ImgBannerView
import cc.vv.btpartyjob.jobactivities.R
import cc.vv.mvp.delegate.BaseAppDelegate

/**
 * 头条新闻托管类
 * Created by Chen.qi on 2018/10/24.
 */
class HeadlineNewsActivityDelegate : BaseAppDelegate() {

    override fun initWidget() {
    }

    override fun initLayoutRes(): Int {
        return R.layout.activity_heading_news
    }

    /**设置标题title*/
    fun setTopBarTitle(topBarTitle: String?) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_ahn_topBar)
        titleBar?.setTitle(topBarTitle)
        if ("宝塔头条" == topBarTitle) {
            titleBar?.rl_ljtb_right_layout?.visibility = View.GONE
        } else {
            titleBar?.rl_ljtb_right_layout?.visibility = View.VISIBLE
        }
    }


    /**设置标题右边按钮点击事件*/
    fun setTitleBackBtnOnClick(event: BaseTopBarView.EventInterface) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_ahn_topBar)
        titleBar?.setEventInterface(event)
    }

    /**
     * 设置banner
     */
    fun setBannerData(headView: View?, list: ArrayList<String>, listTitle: ArrayList<String>, inter: ImgBannerView.ImgBannerClickInter) {
        val bannerView = headView?.findViewById<ImgBannerView>(R.id.ibv_head_view_banner)
        bannerView?.initWHPercentage(351, 166, -1)
        bannerView?.initImgData(list, listTitle, inter)

        bannerView?.initIndicatorView(R.mipmap.icon_point_selector_no, R.mipmap.icon_point_selector_yes, 8, 5)

    }


}